Skip to content

schedule: dp: look up the DP scheduler by core in the LL user thread - #11484

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
kv2019i:202611-fix-dptick-crash
Nov 18, 2026
Merged

lgirdwood merged 1 commit into
thesofproject:mainfrom
kv2019i:202611-fix-dptick-crash

Conversation

@kv2019i

@kv2019i kv2019i commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

With CONFIG_SOF_USERSPACE_APPLICATION and CONFIG_SOF_USERSPACE_LL, scheduler_dp_ll_post_tick() runs in the LL user thread on every LL tick and finds the DP scheduler with scheduler_get_user_data(). This now reads the kernel-only copy of the user scheduler list, so the LL thread takes a load/store privilege exception (EXCCAUSE 26) as soon as audio starts.

Pass the core of the calling LL scheduler to scheduler_dp_ll_post_tick() and look up the DP scheduler with arch_user_schedulers_get_for_core(), which is safe to call from user threads. Use the same core for the DP lock instead of cpu_get_id(), which reads a privileged register.

Fixes: 91c2148 ("schedule: keep user scheduler descriptors read-only to user threads")

With CONFIG_SOF_USERSPACE_APPLICATION and CONFIG_SOF_USERSPACE_LL,
scheduler_dp_ll_post_tick() runs in the LL user thread on every LL tick
and finds the DP scheduler with scheduler_get_user_data(). This now
reads the kernel-only copy of the user scheduler list, so the LL thread
takes a load/store privilege exception (EXCCAUSE 26) as soon as audio
starts.

Pass the core of the calling LL scheduler to scheduler_dp_ll_post_tick()
and look up the DP scheduler with arch_user_schedulers_get_for_core(),
which is safe to call from user threads. Use the same core for the DP
lock instead of cpu_get_id(), which reads a privileged register.

Fixes: 91c2148 ("schedule: keep user scheduler descriptors read-only to user threads")
Signed-off-by: Kai Vehmanen <[email protected]>
@kv2019i

kv2019i commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

This fixes a regression on Intel NVL platforms. #11469 and #11440 independently passed tests on NVL platform, and both were merged (given tests passed). But together, they trigger this problem and DP tick req hit an unprivileged access and caused a DSP panic. This PR fixes the problem.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the DP post-tick scheduler changes.

No open issues 🎉

What changed in this PR

This PR fixes audio-startup privilege exceptions when the low-latency scheduler runs in user space. It updates the data-processing (DP) scheduler’s post-tick handling to avoid kernel-only scheduler data and privileged core-ID reads.

Changes:

  • Pass the calling low-latency scheduler’s core ID to the DP post-tick hook.
  • Use a user-accessible scheduler lookup and the supplied core ID for DP locking.
  • Update the hook’s declaration and parameter documentation.
File Description
src/​schedule/​zephyr_ll.c Passes the scheduler’s core ID to the post-tick hook.
src/​schedule/​zephyr_dp_schedule.c Uses the supplied core for user-safe DP lookup and locking.
src/​include/​sof/​schedule/​dp_schedule.h Updates the hook signature and documents its core parameter.

Review effort: Balanced

@intel-sofci

Copy link
Copy Markdown

PR 11484: test results

Run date: 2026-11-18 11:47 UTC

Tested commit: a6ec1a7ad683be3733b71a3f93484f87ff920ce2

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

@lgirdwood
lgirdwood merged commit 6b0ba55 into thesofproject:main Nov 18, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants